package xuegao.study.mall.admin.feign;

import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import xuegao.study.mall.admin.dto.study.exam.Exam;
import xuegao.study.mall.admin.dto.study.exam.Question;

@FeignClient(contextId = "api", name = "ask-sys-service", path = "/api/v1")
public interface AskServiceClient {

    /****************题目******************/
    @ApiOperation("题目列表")
    @PostMapping(value = "/questions/getAll")
    String getAllQuestions(@RequestBody JSONObject data);
    @ApiOperation("题目详情")
    @GetMapping(value = "/questions/get/{id}")
    String getQuestionDetail(@PathVariable("id") String id);
    @ApiOperation("题目新增")
    @PostMapping(value = "/questions/create")
    String createQuestion(@RequestBody Question question);
    @ApiOperation("题目删除")
    @GetMapping(value = "/questions/delete/{id}")
    String deleteQuestion(@PathVariable("id") String id);

    /****************试卷******************/
    @ApiOperation("试卷列表")
    @PostMapping(value = "/exams/getAll")
    String getAllExams(@RequestBody JSONObject data);
    @ApiOperation("试卷详情")
    @GetMapping(value = "/exams/get/{id}")
    String getExamDetail(@PathVariable("id") String id);
    @ApiOperation("试卷新增")
    @PostMapping(value = "/exams/create")
    String createExam(@RequestBody Exam exam);
    @ApiOperation("试卷删除")
    @GetMapping(value = "/exams/delete/{id}")
    String deleteExam(@PathVariable("id") String id);
    @ApiOperation("试卷发布")
    @GetMapping(value = "/exams/publish/{id}")
    String publishExam(@PathVariable("id") String id);

    /*****************答题**************/
    @ApiOperation("试卷列表")
    @PostMapping(value = "/ask/exam/list")
    String getAskExamsList(@RequestBody JSONObject data);
    @ApiOperation("试卷详情")
    @GetMapping(value = "/ask/exam/detail/{id}")
    String getAskExamsDetail(@PathVariable("id") String id);

    @ApiOperation("试卷详情")
    @GetMapping(value = "/ask/exam/questions/{examId}")
    String getExamsQuestionList(@PathVariable("examId") String examId);

    @ApiOperation("考试记录-创建")
    @PostMapping(value = "/ask/record/create")
    String createExamRecord(@RequestBody JSONObject requestBody);
    @ApiOperation("考试记录-提交")
    @PostMapping(value = "/ask/record/submit")
    String submitExamRecord(@RequestBody JSONObject requestBody);

    @ApiOperation("考试记录-查询")
    @PostMapping(value = "/ask/record/detail/{recordId}")
    String getExamRecord(@PathVariable("recordId") String recordId);



}
